<!--# layout("/common/leftmallout.html",{"jsBase":"/js/user/userScholarship/"}){ -->
<script src="http://ziyunoss.oss-cn-hangzhou.aliyuncs.com/pop/mall/style/library.js"></script>
<link rel="stylesheet" href="http://ziyunoss.oss-cn-hangzhou.aliyuncs.com/pop/mall/style/member.css">
<link rel="stylesheet" href="http://ziyunoss.oss-cn-hangzhou.aliyuncs.com/pop/mall/style/page.css">
<div class="center">
	<div class="section" style="height:645px;">
    	<!-------------面包屑--------------------->
            <div class="bread-crumbs">
                    <br/>
                </div>
        <!------------------主体结构--------------------->
        <div class="small-page">
         <!--左侧-->
        	
       <!-------左侧end-------->
       <!-------右侧-------->
            <div class="page-article">
            	<div class="area_mend_head">
                    <span>我的奖励金</span>
                    <i class="member-more-r">您当前的奖励金为：<strong class="scholarship"></strong></i>
                </div>
              	<div class="area_mood_hd">奖励金充值记录</div>
                <div class="area_mend_body">
                <table class="area_mood_tanle">
                    	<thead>
                        	<tr>
                            	<td>充值时间</td>
                                <td>充值用途</td>
                                <td>存入金额</td>
                                <td>支出金额</td>
                            </tr>
                        </thead>
                        <tbody class="tbodyScholarship">
                        </tbody>
                    </table>
				</div>
				 <div class="boxDiv">
			<div class="box">分页内容要显示的地方</div>
			</div>
        </div>
				
            </div>
       <!-------右侧end-------->
       
        
        <!------------------->
    </div>
    
</div>

<!--#} -->
<script>
doAjax('/user/userWallet/getUserWallet.json','post','',function(res){
	if(res.code=='200'){
    	var userWallet=res.data.userWallet;
		if(userWallet){
			var scholarship;
			if(userWallet.scholarship == null){
				scholarship = "0";
	    	}else{
	    		scholarship=userWallet.scholarship;
	    	}
	    	$('.scholarship').html("￥"+scholarship);
		}
	}
},'');
var html=$('.page-aside');
var righthtml=$('.page-article');
$('.small-page').empty();
$('.small-page').append(html);
$('.small-page').append(righthtml);

this.pageing();

function pageing(){
	doAjax('/user/userScholarship/listScholarshipRecord.json', 'post','', function(ret){
		if(ret.code=='200'){
			var total=ret.data.scholarshipRecordVOPage.total;//总数据数量
			var totalPage=ret.data.scholarshipRecordVOPage.totalPage;//总页数
			var current=ret.data.scholarshipRecordVOPage.current;//第几页
			var size=ret.data.scholarshipRecordVOPage.size;//每页数量
	        $(function(){
		    	 var option={
		    	         pageNo:  current, // 初始页码
		    	         totalPages:  totalPage, //总页数
		    	         totalCount:  total, // 条目总数
		    	         slideSpeed:  600, // 缓动速度
		    	         jump:true, // 支持跳转
		    	         callback: function(page) {
		    	        	 showScholarship(page);
		    	             //根据当前页查数据
		    	         } // 回调函数
		    	     }
		    	     $(".box").paging(option);
		    	  })
		}
	})
}
function showScholarship(pageNo){
	doAjax('/user/userScholarship/listScholarshipRecord.json','post',{"pageNo":pageNo},function(res){
		if(res.code=='200'){
			var scholarshipRecordVOList=res.data.scholarshipRecordVOPage.records;
			var total=res.data.scholarshipRecordVOPage.total;//总数据数
		    $('.tbodyScholarship').empty();
		    var html="";
		    for(var i=0;i<scholarshipRecordVOList.length;i++){
		    	var userScholarship=scholarshipRecordVOList[i];
		    	html+='<tr>'+
			        	'<td><span>'+userScholarship.mtime+'</span></td>'+
			            '<td><span>'+userScholarship.message+'</span></td>'+
			            '<td><span>'+userScholarship.importMoney+'</span></td>'+
			            '<td><span>'+userScholarship.explodeMoney+'</span></td>'+
			        '</tr>';
		    }
		    $('.tbodyScholarship').append(html);
		}
	},'');
}

</script>


<script>
	
   

$('#scholarship').css({'color':'#6647b2','font-weight':'900'});
</script>



